The present invention relates to transmitting and running computer programs on a computer network. More specifically, the invention provides a framework in which modifications to a program that can be presented in multiple forms need only be made once.
One example of a computer program that may be cast in more than one form, where each form of the program carries out more or less the same function but runs in different contexts or settings, is a program written in the Java programming language. Other examples may be found in computer programs written in languages such as Smalltalk and C++, and the framework and methodology described may be applied to programs written in such languages and to programs in languages that have yet to be fully developed.
However, in using a Java program to illustrate the present invention, it is helpful to provide a detailed background for Java, and how the different forms of the Java program execute in different settings. Generally, Java.TM. is an object-oriented, platform-independent computer programming language and environment initially designed for writing programs that run over the Internet. Specifically, one of the goals of Java.TM. was to enable Internet programmers to create more lively and interactive sites on the World Wide Web (the "Web"). The Web is one facet of the Internet that allows entities or individuals to create Web sites where a site is an exclusive "space" accessible through the Internet where, generally speaking, information can be displayed. A Web site is typically contained on a server which transmits data to a client computer running a browser program. A browser is a computer program that provides a user with a window and various controls through which data from a remote server that stores the Web site can be viewed and navigated. Given the explosive growth of the Internet over the past several years, the number of sites on the Web has increased by orders of magnitude over the years, now ranging in the hundreds of thousands. Web sites are now created and used by individuals, families, corporations, government agencies, nonprofit organizations, academic institutions, and associations of all types to provide information to whoever may want it. The vast majority of Web sites are static; that is, they display information (usually text, simple graphics, and occasionally photographs) and do not do much else. They can be updated by the site creator, but typically cannot interact with a user (i.e. a visitor to the Web site).
However, the static nature of Web sites is changing. As early as late 1995 and early 1996, Web site developers have been adding other forms of media such as animation, sound, and video to Web sites. As a result, sites began offering its users moving objects through animation, and sound such as speech or music. Returning to the Java example, one use of Java.TM. is to enhance the capability of displaying these and other types of media on Web sites and to offer the previously unavailable capability of making Web sites interactive. Java.TM. also allows a site to provide real-time displays of complex data. A Web site that takes advantage of Java.TM. can have its users control--to a substantial degree--events that occur in the Web site. Previously, a user could go to different pages in a Web site (a page being simply another section of the site not visible on the screen and that can be linked to using a hypertext command) by clicking on an icon or symbol, or could even establish links to other related Web sites. It was also possible, with some of the more sophisticated sites, to enter information through, for example, a questionnaire. This information could then later be evaluated by the site's creator. With Java.TM.-enhanced sites, users can now be more dynamic and interactive when visiting a site.
For example, suppose a computer graphics software company named C-Graphics, Inc. created a Web site where users can walk through a virtual environment called "CG World," comprised of several levels, so they can learn more about C-Graphics' products and services in an entertaining way. When a user enters the site, the user chooses which level to visit. After choosing a level, a voice comes on giving further details on what can be done on this level. As the user is moving up (or down) to this level, for example, in a glass-wall elevator, the user is able to briefly see and hear, through animation sequences and audio clips, activities taking place while passing the other levels. This sequence gives the user a real-life feeling of movement through a virtual environment. When arriving at the chosen level, the user gets off the elevator and begins walking down a wide corridor or sidewalk with a variety of activity rooms or booths on both sides where various C-Graphics products and services are being demonstrated or displayed. Using the keyboard or pointer device (e.g. a mouse or joystick), the user can enter any one of the booths. The user enters a room where C-Graphics demonstrates the functionality and enhancements of its latest graphics software with accompanying sound. It does this by letting the user play a computer game that vividly demonstrates C-Graphics new graphics software.
CG World is an example of a highly interactive Web site. It uses several different media to convey information to a user in an engaging and entertaining way, as through the computer game. A Web site is created by writing a program in a Web page description language, such as Hypertext Markup Language (HTML). A Web site can be made multimedia and highly interactive by inserting Java.TM. programs called applets into HTML code (the HTML code actually contains tags to Java.TM. applets and may also receive parameter values for the applets and pass them on to the applets through the Web browser). The HTML code is contained in an HTML document. CG World would probably have several applet calls for each animation and sound sequence and separate applet calls for processing input by the user. There is also very likely one applet for each computer game from which the user could choose. These applet tags are embedded in the HTML document which creates the static background (graphics, text, etc.) in the Web site, and may provide the setting for the multimedia and interactive components to run.
A user accesses a Web site through a browser which resides on the user's computer, also referred to as the client machine. A browser is a program that seeks, downloads, and displays Web sites and also executes any programs needed for the operation of that Web site. Thus, a user brings up the browser on the client machine and downloads the C-Graphics Web site CG World. When the user begins walking through the Web site, the browser begins running Java.TM. applets. The browser must be equipped with a Java.TM. Virtual Machine (VM) which allows the browser to interpret Java.TM. applets. Browsers so equipped are considered Java.TM.- enabled and can take advantage of Java.TM.-enhanced Web sites. Examples of such browsers are Hot Java.TM. available from Sun Microsystems of Sunnyvale, Calif., Netscape Navigator 3.0 available from Netscape Communications of Menlo Park, Calif., and Internet Explorer 4.0 available from Microsoft Corporation of Redmond, Wash.
It should be noted that other languages can have different forms of a program that performs the same function, and that the present invention can be used in programming environments other than Java. Thus, using the Java example, it is helpful to keep in mind that an applet program may represent one form of the program and an application program can represent another form of the program with the same function. Continuing with the Java example, an applet does not have a single executable file; it is typically contained within class files or classes. Most Java.TM. applets are spread across several classes, which may be contained in one or more class libraries. Classes define Java.TM. program building blocks called objects as well as behavior and attributes of the objects. To run a Java.TM. applet from a Web site, the site developer inserts tags into the HTML code, or the code of some type of page description language, which instruct the browser to download the appropriate classes from the Web server and then interpret the classes. Specifically, the tag identifies the Java.upsilon. classes needed for running the applet and may also set parameter values.
In Java there are two forms of a program: applets and applications. Applets, as discussed above, are essentially embedded in HTML documents and are executed by a Java.TM.-enabled browser. A Java.TM. application is designed to run on a client machine's operating system and is executed by the user. Once it is downloaded onto the client machine, typically from a Web site--but not necessarily so--it can run as a stand-alone application without any connections to the Internet. It is useful to remember that even though Java.TM. is closely associated with Web sites and browsers, it is a robust, independent, and fully functional programming language and applications written in Java.TM. are capable of running on stand-alone computers. Java.TM. applications can be run, like a spreadsheet or word processing application, without any association or connection to the Internet. A Java.TM. application is also comprised of classes which make up one or more class libraries. All the classes needed by the application are available on the client machine, whereas with an applet the browser may have to make calls to the Web server (described below) over the Internet for classes as they are needed
The same function can be performed by different forms of the same program written in a particular language, such as an applet program and an application program. For example, the computer game chosen by the user in CG World so she can see a demonstration of C-Graphics' software can be cast as an applet or an application. In this example, the program executed in CG World was a Java.TM. applet because it was executed by and run on the browser. The classes needed to run the game were dynamically called from the Web server as they were needed. The computer game can also be programmed as a Java.TM. application. It should be noted that some functions performed by Java.TM. programs, or programs in another language, while originally intended to run in a particular context, such as in a Web site, can be useful or entertaining functions in their own right. That is, they can have a purpose independent of a particular context. The computer game in CG World, while serving C-Graphics' purpose in promoting its products, may be an entertaining and desirable game to have on one's personal computer to play at anytime, independent of the Web site. Thus, it is useful to have the game as a Java.TM. application which a user (not browser) can download onto a hard drive and, thereafter, play whenever the user wants to without having to access the Internet. This can also be done for a unique or elaborate animation sequence or audio clip in a Web site which a user may want to download and store on the user's hard drive to run at a later time.
The HTML documents and other files related to a Web generally reside on a server computer known as a Web server. Although Web servers vary greatly in processing speed and memory, they are essentially generic computers with a CPU, co-processors, and memory. FIG. 6 discussed in the specification describes in further detail the components of a computer as used in the described embodiment. The different types of computers that can act as a server are well known to those in the computer field. Larger entities such as corporations or government agencies have their own Web servers that contain their Web sites. These servers are typically on the entity's private network, such as an Intranet, and are dedicated to Internet-related functions and may often be responsible for connecting nodes on the private network to the Internet. They typically have high processing speeds and large amounts of memory.
FIG. 1A is a schematic illustration of an example of a prior art relationship in which a computer program, cast in two forms, one of which is an applet program, carries out the same function but must be updated or modified separately even though the changes to code in both forms are the same. The example is the same as that outlined above using the Java example. The illustrative relationship is between a Web server and a client machine running a browser via the Internet and of the files residing on each computer. A Web server 102 is connected to the Internet 104 via a communication link 106, such as a telephone line and is typically a node on a private network (not shown). Server 102 can be a generic computer or a computer specially configured to act solely as a Web server. Server 102 has a memory storage area 108 containing various files and libraries generally related to the Internet 104 and the Web site 110, among other standard operating system files and programs. HTML document 112 contains HTML code that constructs Web site 110 when executed. HTML document 112 contains a tag that invokes applet file 114 containing Java.TM. language code. Another type of Javam program is a Java.TM. stand-alone application 116. The stand-alone application 116 which is not called by HTML document 112 performs the same function as applet 114. Both stand-alone application 116 and applet 114 do not have a single executable file although the code may reside in one or more files. As mentioned above, applets and applications are comprised of classes. These classes 118 are grouped into one or more class libraries 120. Classes 118 define program building components called objects. Memory 108 also contains media files 122 such as image files and audio clips. Finally, memory 108 also contains a user data storage area 124. Area 124 is used to retain data such as default settings, preferences and saved output data of users running applet 114. If applet 114 is interactive and accepts information from the user it may be desirable to save this information for later use by the same user. Storage area 124 is generally useful only when a user shares information and interacts with the Web site running an applet. For example, in the CG World Web site, the user playing the computer game may want to keep preferred game settings, scores, or tags indicating where she left off the last time she played, so that the next time she runs the applet this information will be available. Communication medium 126 connects client machine 128 with the Internet 104. Client machine 128 can be any type of general purpose computer with a monitor 130 and memory. Client machine 128 may also be a node on a private network with access to the Internet via an Internet server similar to server 102. A user can access a Web site 110 through a browser 134. If the Web site is Java.TM. enhanced such as site 110 contained on server 108 the user must have a Java.TM. enabled Web browser 134 to take advantage of imbedded Java.TM. applets. Client machine 128 installed with a Java.TM.-enabled browser has downloaded Web site 110 and is running applet 114. Memory 132 contains HTML document 112 and a subset 136 of classes 118.
Classes 136 are needed to begin running applet 114. If other classes are needed from class library 120, they are called dynamically as they are needed. Also contained on memory 132 is applet code 114 which is downloaded from server 102 by browser 134. Media files 122 are also downloaded onto memory 132 if they are needed by applet 144.
FIG. 1B is a schematic illustration of an example of a prior art relationship in which a computer program, cast in two forms, one of which is an application program, carries out the same function but must be updated or modified separately even though the changes to code in both forms are the same. The illustration is the same as the example outlined. The relationship is between Web server 102 and a client machine 138 running a stand-alone application 116, and the files residing on their respective memory. Web server 102 components and files are the same as those in FIG. 1a. On the client side, client machine 138 is running its local operating system 140, such as the Solaris Operating System available from Sun Microsystems. It is not running a Web browser as in FIG. 1a. Client memory 142 contains stand-alone application code 116 and class library 120 in its entirety. This is necessary because client machine 138 does not make dynamic calls to Web server 102 when running a Java.TM. stand-alone application 116. The application 116 may have been downloaded previously from a Web site using a browser, but the connection 144 to the Internet is not necessary when running stand-alone application 116. Media files 122 and HTML document 112 are also contained on memory 142. Thus, application 116 has all the components it needs to run without having to make calls to Web server 102. The user executes application 116 which runs on top of the client machine's operating system 140.
As shown in FIGS. 1A and 1B, memory 108 contains two programs: applet 114 and application 116. Both programs perform the same function. Presently, when updates are made to improve the particular function, both programs must be modified. Having to update two programs when changes are required is a time-consuming and error-prone procedure. This is true for computer programs written in most programming languages. Typically, the programmer or programming team must physically open all files containing program code and make the changes. Once this is done, the programs must be tested and debugged. Having to do this with one large program is a time-consuming task in itself; having to make exactly the same changes in two programs can make the task significantly more burdensome and can make the program update process more error-prone. For example, with the growth of Java.TM.-enhanced Web sites, the requirement for dual updates is becoming an increasing problem for Web site owners and developers. In addition, because of time constraints or neglect, different forms of the same program may not be updated by the programmers at the same time (or within an acceptable time period), thus resulting in two versions of the same program over time. It should be kept in mind that presently programmers must go into the code of each version of the program and make the same changes necessary such that the functionality of the programs remains the same. Maintaining program integrity over time is also an essential task of the programmer and a vital component in the development of the computer program over time. In the case of Java.TM., an applet and application may not be updated at the same time thus resulting in two versions of the same program over time; for example, one running on the Web site and a different one downloaded by users. Keeping track of these updates and maintaining program integrity could easily become a serious problem for the Web site owner and developer. It would be desirable to have a program framework that would permit a single program, cast in more than one form, to behave according to the context in which it is being run. This would eliminate the need for having to physically update--all within an acceptable time period--multiple forms of the same program. For example, it would be desirable to have a program framework that would permit a single program to behave as an applet or stand-alone application depending on whether it is being invoked in a browser or on top of a user machine's operating system